package boot.spring.controller;

import boot.spring.entity.Student;
import boot.spring.service.AllTheStudentsService;
import boot.spring.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/*全部学生页面的控制层
* 分页多条件查询学生
* 编辑学生信息
* 删除学生信息
* */
@RequestMapping("/AllTheStudentsController")
@RestController
public class AllTheStudentsController {
    /*注入全部学生的业务层*/
    @Autowired
    private AllTheStudentsService allTheStudentsService;

    /*分页多条件获取学生信息*/
    @GetMapping("/ListStuConPageLimitAll")
    public Result ListStuConPageLimitAll(Integer page,Integer limit,String stuname,String ifPay,String qq,String sex) {
        return allTheStudentsService.ListStuSerPageLimitAll(page,limit,stuname,ifPay,qq,sex);
    }
    /*编辑学生信息*/
    @PostMapping("/GetStuConUp")
    public Result GetStuConUp(Student stuup) {
        return allTheStudentsService.GetStuSerUp(stuup);
    }
    /*删除学生信息*/
    @PostMapping("/GetStuConDel")
    public Result GetStuConDel(Integer stuid) {
        return allTheStudentsService.GetStuSerDel(stuid);
    }

}
